package design_6_adapter.demo1.controller;

/**
 * SimpleServletHandlerAdapter 适配器处理 Servlet 接口, 需在web.xml 中配置
 */
public class TestServletController {


	public void init() {
	}

	/**
	 * get 请求
	 */
	public void doGet(String request, StringBuilder response) {
		response.append("{\n" +
				"\"id\":\"1\",\n" +
				"\"name\":\"Servlet 适配器测试\",\n" +
				"\"age\":\"22\"\n" +
				"}");

		this.doPost(request, response);
	}


	/**
	 * post请求
	 *
	 * @param request
	 * @param response
	 */
	public void doPost(String request, StringBuilder response) {

	}
}
